﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CodeStudy.WPF.Model;
using C1.WPF.C1Chart;

namespace CodeStudy.WPF
{
    /// <summary>
    /// Interaction logic for ChartTestMultipleSeries.xaml
    /// </summary>
    public partial class ChartTestMultipleSeries : PageControlBase
    {
        public ChartTestMultipleSeries()
        {
            InitializeComponent();

            this.chtTest.BeginUpdate();
            this.chtTest.Data.ItemNames = new string[] { "Test Data" };
            for (int i = 0; i < 10; i++)
            {
                DataSeries ds = new DataSeries();

                ds.PointLabelTemplate = this.TryFindResource("dataLabel") as DataTemplate;

                ds.Label = string.Format("ds_{0}", i);
                double v = Convert.ToDouble(new Random(i).Next(700, 3700));
                DoubleCollection values = new DoubleCollection();
                values.Add(v);
                ds.Values = values;
                this.chtTest.Data.Children.Add(ds);
            }

            chtTest.View.AxisY.Min = 500;
            chtTest.View.AxisY.Max = 4000;

            this.chtTest.EndUpdate();


        }
    }
}
